export class Queue {
    constructor(arr) {
        this.arr = arr
    }
    next() {
        this.arr.push(this.arr.shift())
        return this.arr[0]
    }
    last() {
        this.arr.unshift(this.arr.pop())
        return this.arr[0]
    }
}